/***************************************************************************
 * 文件名:CodingSchemesVersionsDao.java<br>
 * 版本: <br>
 * 描述: <br>
 * 版权所有: <br>
 * //////////////////////////////////////////////////////// <br>
 * 创建者: robo<br>
 * 创建日期: 2010-11-15 <br>
 * 修改者: <br>
 * 修改日期: <br>
 * 修改说明: <br>
 **************************************************************************/
package com.sunwayhorizo.health.ets.base.service.dao;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.Query;

import org.jboss.seam.annotations.JndiName;
import org.jboss.seam.annotations.Name;

import com.sunwayhorizo.health.ets.base.common.BaseDao;
import com.sunwayhorizo.health.ets.base.persistent.EtVersions;

@Stateless
@Name("CodingSchemesVersionsDao")
public class CodingSchemesVersionsDao extends BaseDao implements ICodingSchemesVersionsDao{

	public EtVersions getEtVersions(String codingSchemesID){
		if(codingSchemesID == null || codingSchemesID.equals("")){
			return null;
		}
		String jpql = " select o from EtVersions o where o.etCodingSchemes.codingschemeId=:codingSchemesID ";
		Query query = entityManager2.createQuery(jpql);
		query.setParameter("codingSchemesID", codingSchemesID);
		List<EtVersions> list = query.getResultList();
		if(list != null && list.size() > 0 ){
			return (EtVersions)list.get(0);
		}
		return null;
	}
}


